package com.jt.yygh.common.exception;

import com.jt.yygh.common.result.ResultCodeEnum;
import lombok.Data;

/**
 * @author jiang tao
 * @date 2022/3/1
 * @description:
 **/
@Data
public class BizServiceException extends RuntimeException{

    private Integer code;
    private String errMsg;

    public BizServiceException(String errMsg) {
        super(errMsg);
        this.errMsg = errMsg;
    }

    public BizServiceException(Integer code, String errMsg) {
        super(errMsg);
        this.code = code;
        this.errMsg = errMsg;
    }

    public BizServiceException(ResultCodeEnum resultCodeEnum) {
        super(resultCodeEnum.getMessage());
        this.code = resultCodeEnum.getCode();
        this.errMsg = resultCodeEnum.getMessage();
    }
}
